//
//  DisclaimerView.m
//  WildDonkey
//
//  Created by 孙俊 on 15/4/9.
//  Copyright (c) 2015年 lanou. All rights reserved.
//

#import "DisclaimerView.h"

@implementation DisclaimerView

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/
- (void)dealloc
{
	[_docseLabel release];
	[_titleLabel release];
	[_bgView release];
	[super dealloc];
}

- (instancetype)initWithFrame:(CGRect)frame
{
	self = [super initWithFrame:frame];
	if (self) {
		
		CGRect rect = [UIScreen mainScreen].bounds;
		
		CGFloat height = rect.size.height;
		CGFloat width = rect.size.width;
		
		_bgView = [[UIView alloc] initWithFrame:[UIScreen mainScreen].bounds];
		[_bgView setBackgroundColor: [UIColor whiteColor]];
		
		
		_titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, width, 40)];
		self.titleLabel.textAlignment = NSTextAlignmentCenter;
		self.titleLabel.font = [UIFont systemFontOfSize:20];
		[self.bgView addSubview:self.titleLabel];
		
		_docseLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 40, width, height - 40)];
		[self.bgView addSubview:self.docseLabel];
		
		[self.window addSubview:self.bgView];
		
	}
	return self;
}

+ (DisclaimerView *)DisclaimerViewWithFrame:(CGRect)frame
{
	return [[[DisclaimerView alloc] initWithFrame:frame] autorelease];
}

@end
